public class IntSequence {
    // instance variables
    private int [ ] myValues; // sequence elements
    int myCount;  // number of array cells used by the sequence

    // Constructor; the argument will be the actual size
    // of the array, or equivalently, the (temporary) maximum
    // number of elements it can hold.
    public IntSequence (int capacity) {
        if (capacity>0) 
        	myValues = new int [capacity];
        else
        	myValues = new int [0];
        myCount = 0;
    }

    public boolean isEmpty ( ){
    	if (myCount == 0)
    		return true;
    	else return false;

    }
	public int size ( ){
		return myCount;
	}
	public int elementAt (int pos){
		if ((pos >= 0) &&(pos <= myCount))
			return myValues[pos];
		else 
			System.err.println("Invalid argument for elementAt()...Exit");
			System.exit(1);
			return -1;
			// more methods would go here
	}
	// Include the argument among those stored in myValues
    // by placing it in the first unused spot in the array
    // and incrementing the count.
    // Assumption: myValues isn't full.
    public void add (int toBeAdded) {
    		if (myCount >= myValues.length){
    			System.err.println("Invalid argument...Exit");
				System.exit(1);
    		}
    		else {
    			myValues[myCount] = toBeAdded;
    			myCount ++;
    		}
    		
    }
    public String toString(){
    	String myString = "";
    	for (int i= 0;i<myCount;i++){
    		myString = myString + String.format("%d ",myValues[i]);   		
    	}
    	return myString;	
    }
    public void remove(int pos){
    	
    }
}